
<?php include_once(dirname(__FILE__) . '/../general/head.php'); ?>

<!-- header -->
<?php include_once(dirname(__FILE__) . '/../general/header.php'); ?>

<?php include_once('left.php'); ?>


<div id="page-wrapper">


    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Bảng điều khiển</h1>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-4">
            <div class="panel panel-default">
                <div class="panel-body" style="text-align: center;">
                    <a href="<?php echo site_url(get_folder($loggedUser['title']) . '/attitude_detail_results'); ?>">
                        <img src="<?php echo base_url(); ?>images/message_edit.png" height="80px" title="Đánh giá Bone scan"><br/>
                        Đánh giá Bone scan
                    </a>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="panel panel-default">
                <div class="panel-body" style="text-align: center;">
                    <a href="<?php echo site_url(get_folder($loggedUser['title']) . '/attitude_detail_results/confirm'); ?>">
                        <img src="<?php echo base_url(); ?>images/report.png" height="80px" title="Xác nhận đánh giá thái độ"><br/>
                        Xác nhận đánh giá thái độ
                    </a>
                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="panel panel-default">
                <div class="panel-body" style="text-align: center;">
                    <a href="<?php echo site_url(get_folder($loggedUser['title']) . '/attitude_detail_results/report'); ?>">
                        <img src="<?php echo base_url(); ?>images/lock.png" height="80px" title="Kết quả đánh giá thái độ"><br/>
                        Kết quả đánh giá thái độ
                    </a>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Tiến độ
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <?php if ($todoList == false) { ?>
                        Hiện tại không có việc cần làm nào! 
                        <br>
                        <?php
                    } else {
                        foreach ($todoList as $eachTodo) {
                            ?>
                            <div class="checkbox">
                                <label class="tooltip-demo">
                                    <input type="checkbox" disabled="disabled" <?php echo ($eachTodo['status'] == 'done' ? 'checked' : ''); ?> value="">
                                    <label data-container="body" data-toggle="popover" data-placement="right" data-content="<?php echo $eachTodo['note'] ?>" data-original-title="" title="">
                                        <?php if ($eachTodo['status'] == 'current') { ?>
                                            <font color="blue">
                                            <b>
                                                <?php echo substr($eachTodo['start_day'], 0, 10) . " - " . substr($eachTodo['end_day'], 0, 10) . ": &nbsp;&nbsp;" . $eachTodo['title']; ?>
                                            </b>
                                            </font>
                                        <?php } else if ($eachTodo['status'] == 'done') {
                                            ?>
                                            <strike>
                                                <?php echo substr($eachTodo['start_day'], 0, 10) . " - " . substr($eachTodo['end_day'], 0, 10) . ": &nbsp;&nbsp;" . $eachTodo['title']; ?>
                                            </strike>
                                            <?php
                                        } else {
                                            echo substr($eachTodo['start_day'], 0, 10) . " - " . substr($eachTodo['end_day'], 0, 10) . ": &nbsp;&nbsp;" . $eachTodo['title'];
                                        }
                                        ?>
                                        &nbsp;&nbsp;
                                        <font size="4px">
                                        <?php echo $eachTodo['note'] != '' ? '<i class="fa fa-tag"></i>' : ''; ?>
                                    </font>
                                    </label>
                                </label>
                            </div>
                            <?php
                        }
                    }
                    ?>

                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Danh sách nhân viên SS/KAS
                </div>
                <div class="panel-body">
                    <?php if ($ssList == false) { ?>
                        Hiện tại không có nhân viên SS/KAS nào!
                        <br>
                    <?php } else { ?>
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th width="70px">Mã NV</th>
                                        <th>Họ và tên</th>
                                        <th>Đã đánh giá</th>
                                        <th>Đã xác nhận</th>
                                        <th>Kết quả</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php foreach ($ssList as $eachSS) {
                                        ?>
                                        <tr>
                                            <td><?php echo $eachSS['code']; ?></td>
                                            <td><?php echo $eachSS['name']; ?></td>
                                            <td><?php echo $eachSS['progress']; ?></td>
                                            <td><?php echo $eachSS['progress2']; ?></td>
                                            <td><a href="<?php echo site_url(get_folder($loggedUser['title']) . '/final_results/index/' . $eachSS['code'] . '/' . 'all'); ?>"><img src="<?php echo base_url(); ?>images/application_view_list.png" height="20px" /></a></td>
                                        </tr>
                                    <?php }
                                    ?>
                                        <tr>
                                            
                                            <td colspan="2"><b>TỔNG SỐ</b></td>
                                            <td><?php echo $eachSS['totalProgress']; ?></td>
                                            <td><?php echo $eachSS['totalProgress2']; ?></td>
                                            <td></td>
                                        </tr>

                                </tbody>
                            </table>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>


</div>
<!-- /#page-wrapper -->

<?php include_once(dirname(__FILE__) . '/../general/footer.php'); ?>
<script>
    // popover demo
    $("[data-toggle=popover]")
            .popover();
</script>